package ru.develbureau.server.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class OutTag extends SimpleTagSupport{
	private static final long serialVersionUID = 1L;
	String val = null;
	
	public void doTag() throws JspException {
		try{
			PageContext pageContext = (PageContext) getJspContext(); 
		    JspWriter out = pageContext.getOut(); 
			if(val!=null){
				out.println(val);
			}
		}catch (Exception e) {
		}
	}
	
	public void setValue(Object value){
		if(value!=null && value instanceof String){
			val = (String)value;
		}
	}
	
	public Object getValue(){
		return val;
	}
}
